<?php

/**
 * persona form.
 *
 * @package    istmo
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class personaForm extends BasepersonaForm
{
  public function configure()
  {
              $imagen = '/uploads/contenidos/persona/' . $this->getObject()->foto;
        
        $this->widgetSchema['foto'] = new sfWidgetFormInputFileEditable(array(
            'label' => 'Foto',
            'file_src' => $imagen,
            'is_image' => true,
            'edit_mode' => !$this->isNew(),
            'template' => '<style>.fix img{max-width:200px; display:block;}</style><div class="fix">%file%</div><br />%input%<br />',
            'delete_label' => 'Borrar imagen'));

        $this->validatorSchema['foto'] = new sfValidatorFile(array(
            'required' => $this->isNew(),
            'path' => sfConfig::get('sf_upload_dir') . '/contenidos/persona/',
            'mime_types' => 'web_images',
        ));
  }
}
